<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Outstanding Logs</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="assets/css/prettyPhoto.css" rel="stylesheet" type="text/css" />
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
    <![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="http://www.dirtpros.com/images/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body data-spy="scroll" data-target=".bs-docs-sidebar" onload="getRows()">
<!-- Navbar
    ================================================== -->
<div class="nav-agency">
  <div class="navbar navbar-static-top"> 
    <!-- navbar-fixed-top -->
    <div class="navbar-inner">
      <div class="container"> 
        <a class="brand" href="index.html"> 
          <img id="LogoSmall" src="assets/img/logo.jpg" alt="Logo">
        </a>
      </div>
    </div>
  </div>
</div>
<div class="container">
  <div class="marketing">
    <!--<p>&nbsp</p>
    <p>&nbsp</p>-->

    <h2>Collection Log</h2>
    <hr noshade>
	</div>
	&nbsp;&nbsp;&nbsp;&nbsp;
	<blockquote>
	<p class="text-left" id="csite"><strong>Collection Site</strong> : </p>
	<p class="text-left" id="cdate"><strong>Collection Date</strong> : </p>
	<p class="text-left" id="collector"><strong>Collector</strong> : </p>
	<p class="text-left" id="cregion"><strong>Region</strong> : </p>
	</blockquote>
	
	<div class="marketing">
	<hr noshade>
	&nbsp;&nbsp;&nbsp;&nbsp;
	<div class="btn-group">
	<!--<button class="btn btn-success"><i class="icon-eye-open icon-white"></i> View</button>-->
	<button class="btn btn-warning btn-large">&nbsp;&nbsp;<i class="icon-wrench icon-white"></i>&nbsp;&nbsp;Modify&nbsp;&nbsp;&nbsp;</button>
	<button class="btn btn-success btn-large"><i class="icon-ok icon-white"></i>&nbsp;&nbsp;Approve&nbsp;</button>
	<button class="btn btn-danger btn-large">&nbsp;&nbsp;<i class="icon-flag icon-white"></i>&nbsp;&nbsp;Flag&nbsp;&nbsp;&nbsp;&nbsp;</button>
	</div>
	&nbsp;&nbsp;&nbsp;&nbsp;
    <table id ="logsTable"class="table table-bordered table-hover" border="1">
    <tr>
    <th align="center">Bag ID</th>
	 <th align="center">Weight</th>
    <th align="center">Wet Trash</th>
    <th align="center">Paper</th>
    <th align="center">Cardboard</th>
    <th align="center">Plastic</th>
	<th align="center">Glass</th>
	<th align="center">Cans</th>
    </tr>
    </table>
  </div>
</div>

<!-- Le javascript
    ================================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> 
<script src="assets/js/jquery.js" type="text/javascript"></script> 
<script src="assets/js/google-code-prettify/prettify.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-transition.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-alert.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-modal.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-dropdown.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-scrollspy.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-tab.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-tooltip.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-popover.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-button.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-collapse.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-carousel.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-typeahead.js" type="text/javascript"></script> 
<script src="assets/js/bootstrap-affix.js" type="text/javascript"></script> 
<script src="assets/js/application.js" type="text/javascript"></script> 
<script src="assets/js/jquery.isotope.min.js" type="text/javascript"></script> 
<script src="assets/js/jquery.prettyPhoto.js" type="text/javascript"></script> 
<script src="assets/js/superfish.js" type="text/javascript"></script> 
<script src="assets/js/custom.js" type="text/javascript"></script>
<script language="javascript">
 function getRows()
 {
   var xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange=function()
  {
    if (xmlhttp.readyState==4)
    {
       jsonObj = JSON.parse(xmlhttp.responseText);
	   var table = document.getElementById("logsTable");
	   //alert("Here");
	   var num = processNum();
	   //alert("num = "+num);
	   
	   var site = document.getElementById("csite");
	   site.innerHTML += jsonObj.Logs[num].site;
	   
	   var date = document.getElementById("cdate");
	   date.innerHTML += jsonObj.Logs[num].date;
	   
	   var collector = document.getElementById("collector");
	   collector.innerHTML += "AAAC";
	   
	   var region = document.getElementById("cregion");
	   region.innerHTML += jsonObj.Logs[num].region;
	   
	   for (var i = 0; i<jsonObj.Logs[num].Bags.length; i++)
	   {
	       var row = table.insertRow(i+1);
		   row.className = "success";
		   var BagID = row.insertCell(0);
		   BagID.innerHTML = jsonObj.Logs[num].Bags[i].bagID;
		   var weight = row.insertCell(1);
		   weight.innerHTML = jsonObj.Logs[num].Bags[i].weight+" lbs";
		   var wetTrash = row.insertCell(2);
		   wetTrash.innerHTML = jsonObj.Logs[num].Bags[i].wetTrashPercentage+"%";
		   var paper = row.insertCell(3);
		   paper.innerHTML = jsonObj.Logs[num].Bags[i].paperTrashPercentage+"%";
		   var cardboard = row.insertCell(4);
		   cardboard.innerHTML = jsonObj.Logs[num].Bags[i].cardboardTrashPercentage+"%";
		   var plastic = row.insertCell(5);
		   plastic.innerHTML = jsonObj.Logs[num].Bags[i].plasticTrashPercentage+"%";
		   var glass = row.insertCell(6);
		   glass.innerHTML = jsonObj.Logs[num].Bags[i].glassTrashPercentage+"%";
		   var cans = row.insertCell(7);
		   cans.innerHTML = jsonObj.Logs[num].Bags[i].cansTrashPercentage+"%";
	   }
    }
  }
  xmlhttp.open("GET", "http://dirtprosdatabase.appspot.com/showlogs?username=aaac"+"&t="+Math.random());
  xmlhttp.send(null);
 
 }
 
 function processNum()
  {
    var parameters = location.search.substring(1).split("=");
	//alert("Parameters : "+parameters[1]);
	var num = parseInt(parameters[1]);
	//alert("Num = "+num);
	return num;
  }
 </script>
</body>
</html>
